﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Cosmetic.Logic;
using Cosmetic.DataEntity;

public partial class Controls_ContentOrderByCreateTime : System.Web.UI.UserControl
{
	private ContentManager m_ContentManager		= new ContentManager();
	private CategoryManager m_CategoryManager	= new CategoryManager();

	protected void Page_Load(object sender, EventArgs e)
	{
		Category theContentTopCategory		= this.m_CategoryManager.GetTopCategryByName(CategoryManager.ETopCategory.Content);
		Category theContentCategory			= this.m_CategoryManager.GetSubCateogoriesBySupCategory(theContentTopCategory).Single(theCategory=>theCategory.Name.Equals("最新情报"));
		this.rptContent.DataSource			= this.m_ContentManager.GetByCategory(theContentCategory).OrderByDescending(theContent=>theContent.CreateTime).Take(10).ToList();
		this.rptContent.DataBind();
	}
}
